pub fn convert_base(input: &str, target_base: u32) -> String {
    let parts: Vec<&str> = input.split('(').collect();
    let number = parts[0];
    let base: u32 = parts[1].trim_end_matches(')').parse().unwrap();

    let decimal_value = u32::from_str_radix(number, base).unwrap();

    if target_base == 10 {
        return decimal_value.to_string();
    }

    let mut target_value = Vec::new();
    let mut value = decimal_value;
    while value > 0 {
        let digit = value % target_base;
        target_value.push(std::char::from_digit(digit, target_base).unwrap());
        value /= target_base;
    }
    target_value.iter().rev().collect()
}